<?php

class Route {
	public $strPath;
	public $strMethod;
	public $function;


	function __call($f, $x) {
		call_user_func_array($this->$f, $x);
	}

	function __construct($strMethod, $strPath, Closure $function) {
		$this->strMethod = $strMethod;
		$this->strPath = $strPath;
		$this->function = $function;
	}

	function execute($api) {
		$this->function($api, $this);
	}

	function matches($method, $path) {
		if($this->strPath == $path && $this->strMethod == $method) {
			return true;
		} else {
			return false;
		}
	}
};

?>